package com.lingkang.cpm.service.impl;

import com.lingkang.cpm.entity.CRole;
import com.lingkang.cpm.entity.CUser;
import com.lingkang.cpm.entity.CUserRole;
import com.lingkang.cpm.mapper.CRoleMapper;
import com.lingkang.cpm.mapper.CUserMapper;
import com.lingkang.cpm.mapper.CUserRoleMapper;
import com.lingkang.cpm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 绫小路
 * @Date 2021/4/1
 */
@Service
public class UserServiceImpl implements UserService {

  @Autowired
  private CUserMapper cUserMapper;
  @Autowired
  private CUserRoleMapper cUserRoleMapper;

  @Override
  public CUser get(String username) {
    return cUserMapper.get(username);
  }

  @Override
  public List<CUserRole> getRoles(String username) {
    return cUserRoleMapper.getRoles(username);
  }
}
